﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xaml;
using System.Reflection;
using System.Xaml.Schema;
using System.Windows.Markup;
using UIT.Markup;

namespace UIT
{
    class BindingMemberInvoker : XamlMemberInvoker
    {
        private Binding b;
        private string name;

        public BindingMemberInvoker(string name, Binding b)
        {
            this.name = name;
            this.b = b;
        }

        public override object GetValue(object instance)
        {
            return b;
        }

        public override void SetValue(object instance, object value)
        {
            ((IBindingContainer)instance).SetBinding(name, b);
        }
    }
}
